var _pagecode = {};
(function() {
    try{
        //声明pagecode-agent.js文件位置
        var agentUrl = "https://ldwxmc.com/default/shanxi/js/pagecode-agent.js";//本次测试位置
        //var agentUrl = "http://sn.ac.10086.cn/ecmp/activiti7/workflow/layuimini/js/chama/pagecode-agent.js";//渠道生产环境位置

		var s2=document.getElementsByTagName("script")[0];
		var s5=document.createElement("script");
		s5.async=true;
		s5.src=agentUrl;
		s2.parentNode.insertBefore(s5,s2);

        //此处可以声明要推送插码数据的接口
        //var apiUrl = "http://localhost:8080/chama/pushData";//本地测试接口
        var apiUrl = "https://ldwxmc.com/CrbtByProvice/ShanXi/inlineCode";//线上生产接口
        //appId统一默认格式: 公司简称小写首字母 + "wbhzpt" 例如:冰蓝  blwbhzpt
        var appId = "cdldwbhzpt";
        //token使用以下默认值
        var appToken = "jnAtApp82F1657022572187";

        _pagecode = {
            appId: appId,
            appToken: appToken,
            apiUrl: apiUrl,
            init: function (option) {
                if (window._vops) {
                    window._vops.init(option);
                } else {
                    console.log(" _vops not exit or is not a function.");
                }

            },
            /**
             * ??????????
             */
            reportData: function (){
                if (window._vops) {
                    window._vops.reportData();
                } else {
                    console.log(" _vops not exit or is not a function.");
                }
            },
            push: function (option) {
                if (window._vops) {
                    window._vops.push(option);
                } else {
                    console.log(" _vops not exit or is not a function.");
                }
            },
            pushSyn: function (option) {
                if (window._vops) {
                    window._vops.pushSyn(option);
                } else {
                    console.log(" _vops not exit or is not a function.");
                }
            },

        }
     //   document.write(unescape("%3Cspan id='vops_stat_icon_1254131450'%3E%3C/span%3E%3Cscript src='"
     //       +agentUrl+"' type='text/javascript' crossorigin%3E%3C/script%3E"));

    }
    catch (e) {
        console.log(e)
    }

})();
